package com.test.spring.relation;

import com.test.spring.autowire.Address;
import com.test.spring.autowire.Person;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/25 20:59
 */
public class Main {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-relation.xml");
        Address address = ctx.getBean("address1", Address.class);
        Address address2 = ctx.getBean("address2", Address.class);
        System.out.println(address);
        System.out.println(address2);

        Person person = ctx.getBean("person", Person.class);
        System.out.println(person);
    }
}
